﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RoleManager.aspx.cs" Inherits="Role_RoleManager" %>

<%@ Register TagPrefix="Site" TagName="Header" Src="Header.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>RoleManager</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="javascript">
		    function DeleteRole(roleID) {
		        if (confirm("Do you want to delete this news?")) {
		            document.all.RoleIDHidden.value = roleID;
		            __doPostBack('Delete', '');
		        }
		    }
		</script>
	</HEAD>
	<body bgcolor="black">
		<form id="Form1" method="post" runat="server">
			<input type="hidden" id="RoleIDHidden" value="0" runat="server">
			<asp:Button ID="Delete" Runat="server" Visible="False"></asp:Button>
			<div style="WIDTH: 300px; BACKGROUND-COLOR: white">
				<Site:Header runat="server" id="Header"></Site:Header>
				<div style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; PADDING-BOTTOM: 2px; COLOR: white; PADDING-TOP: 2px; BACKGROUND-COLOR: #336699">Role 
					Manager</div>
				<table width="100%" bgcolor="gray" style="BORDER-BOTTOM: black 1px solid">
					<tr>
						<td>New Role</td>
					</tr>
				</table>
				<table width="100%">
					<tr>
						<td width="100">Role Name</td>
						<td><asp:TextBox Runat="server" ID="RoleName" Width="100%"></asp:TextBox></td>
					</tr>
					<tr>
						<td></td>
						<td><asp:Button Width="80" Runat="server" ID="AddRole" Text="Add"></asp:Button></td>
					</tr>
				</table>
				<table width="100%" bgcolor="gray" style="BORDER-BOTTOM: black 1px solid">
					<tr>
						<td>All Roles</td>
					</tr>
				</table>
				<asp:DataGrid Width="100%" ID="RolesGrid" Runat="server" AllowPaging="False" AllowSorting="False" AutoGenerateColumns="False" ShowHeader="False" ShowFooter="False">
					<Columns>
						<asp:TemplateColumn>
							<ItemTemplate>
								<%# DataBinder.Eval(Container.DataItem, "RoleName")%>
							</ItemTemplate>
							<EditItemTemplate>
								<asp:TextBox ID="RoleNameEdit" Width="100%" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "RoleName")%>'>
								</asp:TextBox>
							</EditItemTemplate>
						</asp:TemplateColumn>
						<asp:EditCommandColumn EditText="Edit" ItemStyle-Width="40" UpdateText="<img src='Images/yes.gif' alt='Update' border='0'>" CancelText="<img src='Images/no.gif' alt='Cancel' border='0'>"></asp:EditCommandColumn>
						<asp:TemplateColumn ItemStyle-Width="40">
							<ItemTemplate>
								<a href='<%# string.Format("javascript:DeleteRole(\"{0}\")", DataBinder.Eval(Container.DataItem, "RoleID")) %>'>
									Delete</a>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:TemplateColumn Visible="False">
							<ItemTemplate>
								<asp:Label ID="RoleID" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "RoleID") %>'>
								</asp:Label>
							</ItemTemplate>
						</asp:TemplateColumn>
					</Columns>
				</asp:DataGrid>
			</div>
		</form>
	</body>
</HTML>

